<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<link href="shop/css/shop-lunbo.css" rel="stylesheet" />
<script type="text/javascript" src="shop/js/shop-slide.js"></script>
<div class="screen">
						<div class="ck-slide">
							<ul class="ck-slide-wrapper" style="width: 5050px; margin-left: -4040px;">
										<c:forEach items="${shopSlide}" var="shopSlide">
											<li style="float: left; position: relative;">
												<a href="${shopSlide.shopSlideUrl}" target="_blank"> <img src="${shopSlide.shopSlidePicture}"></a>
											</li>
										</c:forEach>
									</ul>
									<a href="javascript:;" class="ctrl-slide ck-prev">上一张</a>
									<a href="javascript:;" class="ctrl-slide ck-next">下一张</a>
									<div class="ck-slidebox">
										<div class="slideWrap">
											<ul class="dot-wrap">
												<li class="current"><em>1</em></li>
												<li><em>2</em></li>
												<li><em>3</em></li>
												<li><em>4</em></li>
												<li><em>5</em></li>
											</ul>
										</div>
									</div>
							</div>
						
						<!-- 轮播js -->
						<script>
							$('.ck-slide').ckSlide({
								dir: 'x', //左右滚动
								autoPlay: true
							});
						</script>
						<script type="text/javascript" language="javascript">
							var PicTotal = 5;
							var CurrentIndex;
							var ToDisplayPicNumber = 0;
							$("div.LunBo div.LunBoNum span").click(DisplayPic);

							function DisplayPic() {
								// 测试是父亲的第几个儿子
								CurrentIndex = $(this).index();
								// 删除所有同级兄弟的类属性
								$(this).parent().children().removeClass("CurrentNum")
								// 为当前元素添加类
								$(this).addClass("CurrentNum");
								// 隐藏全部图片
								var Pic = $(this).parent().parent().children("ul");
								$(Pic).children().hide();
								// 显示指定图片
								$(Pic).children("li").eq(CurrentIndex).show();
							}

							function PicNumClick() {
								$("div.LunBo div.LunBoNum span").eq(ToDisplayPicNumber).trigger("click");
								ToDisplayPicNumber = (ToDisplayPicNumber + 1) % PicTotal;
								setTimeout("PicNumClick()", 3000);
							}
							setTimeout("PicNumClick()", 3000);
						</script> 
					</div>